package cn.com.code.hwjs;

import java.util.Collections;
import java.util.LinkedList;
import java.util.Scanner;

/**
 * 字符串排序
 * https://www.nowcoder.com/practice/5190a1db6f4f4ddb92fd9c365c944584?tpId=37&tqId=21249&rp=1&ru=/exam/oj&qru=/exam/oj&sourceUrl=%2Fexam%2Foj%3Fdifficulty%3D3%26page%3D1%26pageSize%3D50%26search%3D%26tab%3D%25E5%2590%258D%25E4%25BC%2581%25E7%25AC%2594%25E8%25AF%2595%25E7%259C%259F%25E9%25A2%2598%26topicId%3D37&difficulty=3&judgeStatus=undefined&tags=&title=
 *
 * @author zhengpei
 * @date 2022/4/22
 */
public class Hwjs26 {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    while (sc.hasNext()) {
      String str = sc.nextLine();
      sort(str);
      System.out.println();
    }
  }

  private static void sort(String str) {
    LinkedList<String> list = new LinkedList<>();
    char[] chars = str.toCharArray();
    for (int i = 0; i < chars.length; i++) {
      if (chars[i] >= 'a' && chars[i] <= 'z' || chars[i] >= 'A' && chars[i] <= 'Z') {
        list.add(String.valueOf(chars[i]));
      }
    }
    Collections.sort(list, String.CASE_INSENSITIVE_ORDER);

    for (int i = 0, j = 0; i < chars.length; i++) {
      if (chars[i] >= 'a' && chars[i] <= 'z' || chars[i] >= 'A' && chars[i] <= 'Z') {
        System.out.print(list.get(j));
        j++;
      } else {
        System.out.print(chars[i]);
      }
    }

  }

}
